#include "descriptorManager.h"
#include "logger.h"
#include "common.h"
#include "termlist.h"


int main(int argc, char** argv) {
  log_init();
  g_log_context.log_level = LOG_DEBUG;
  int ret;

  FILE* fp = fopen(argv[1], "r");assert(fp);

  idx_index1_t index1;
  uint64_t llsign = 0;

  while(1) {
    ret = fread(&index1, sizeof(idx_index1_t), 1, fp);
    if(ret != 1 && feof(fp)) {
      NOTICE("finish, check[%s] ok", argv[1]);
      exit(0);
    }
    else if(ret != 1) assert(0);

    if(index1.tsign < llsign) {
      FATAL("error , check [%s] error[%llu][%llu]", 
	  argv[1],
	  index1.tsign,
	  llsign);
      exit(-1);
    }
    llsign = index1.tsign;
  }

  return 0;
}

